<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8" />
    <script src="/docs/node_modules/@bugsnag/browser/dist/bugsnag.min.js"></script>
    <script type="text/javascript">
      var NOTIFY = decodeURIComponent(window.location.search.match(/NOTIFY=([^&]+)/)[1])
      var SESSIONS = decodeURIComponent(window.location.search.match(/SESSIONS=([^&]+)/)[1])
      var API_KEY = decodeURIComponent(window.location.search.match(/API_KEY=([^&]+)/)[1])
      Bugsnag.start({
        apiKey: API_KEY,
        endpoints: { notify: NOTIFY, sessions: SESSIONS }
      })
    </script>
  </head>
  <body>
    <script>
      Bugsnag.notify(new Error('no-discriminator'))
      
      // Notify with error that should use client discriminator
      Bugsnag.setGroupingDiscriminator('client-discriminator')
      Bugsnag.notify(new Error('client-discriminator'))
      
      // Notify with error and set event discriminator
      Bugsnag.notify(new Error('event-discriminator'), function (event) {
        event.setGroupingDiscriminator('event-discriminator')
      })
      
      // Notify with error and explicitly set event discriminator to null
      Bugsnag.notify(new Error('null-discriminator'), function (event) {
        event.setGroupingDiscriminator(null)
      })
      
      // Notify with error and explicitly set event discriminator to undefined
      Bugsnag.notify(new Error('undefined-discriminator'), function (event) {
        event.setGroupingDiscriminator(undefined)
      })
      
      // Clear client grouping discriminator
      Bugsnag.setGroupingDiscriminator(undefined)
      Bugsnag.notify(new Error('no-discriminator-2'))
    </script>
  </body>
</html>
